package vip.xiaonuo.app.modular.dict;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.app.core.consts.AppRedisConstant;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.sys.core.cache.RedisCache;

import javax.annotation.Resource;

/**
 * <p>Title : app字典</p>
 * <p>Description : </p>
 * <p>DevelopTools : IDEA</p>
 * <p>DevelopSystem : Windows11</p>
 *
 * @Author : zxw
 * @Date 2023/9/23 10:34
 */
@RestController
@RequestMapping("/api/dict")
public class ApiDictController {

    @Resource
    private RedisCache redisCache;


    /**
     * 从redis获取缓存字典
     * @return
     */
    @GetMapping("/detail")
    public ResponseData detail() {

        DictResult dictResult = (DictResult) redisCache.getCache(AppRedisConstant.APP_DICT);
        return ResponseData.success(dictResult);
    }

}
